package dao

import (
	"gitee.com/zhengjianfeng/pay/models"
	"github.com/go-xorm/xorm"
)

type TestDao struct {
	engine *xorm.Engine
}

func NewTestDao(engine *xorm.Engine) *TestDao {
	return &TestDao{
		engine: engine,
	}
}

func (d *TestDao) Get(id int) *models.Test {
	data := &models.Test{Id: id}
	ok, err := d.engine.Get(data)
	if ok && err == nil {
		return data
	} else {
		data.Id = 0
		return data
	}
}

/*func (d *TestDao) GetAll() []models.TestInfo {

}
*/
